package lyo.levelup.thread;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;

public class GenerateWord implements Runnable{
    private ArrayList <String> al;
    private final int n = 100000;
    private Random rand = new Random();
    public GenerateWord()
    {
        al = new ArrayList <String> (n);
    }
    private void setArrayWord()
    {
       for(int i = 0; i < n; i++)
       {
           al.add("string");
       }
    }
    public void getArrayWord()
    {
        
    }
    @Override
    public void run() {
        try{
        setArrayWord();
        Iterator <String> iter = al.iterator();
        CipherVigenere cv;
        while(iter.hasNext())
        {
          cv = new CipherVigenere(iter.next().toUpperCase(), "STOP");
          cv.output();
          Thread.sleep(1000);
        }
        } catch(Exception e)
        {
            e.printStackTrace();
        }
    }
}